<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:composition template="/view/template.xhtml">
        <ui:define name="head">

        </ui:define>
        <ui:define name="content">
            <f:view>
                <h:form id ="form1">
                    <p:dataTable value="#{financeManager.postings}" var="posting" id="postings" paginator="true" rows="20">
                        <f:facet name="header">
                            <h:panelGrid columns="2" cellpadding="0" cellspacing="0">
                                <p:breadCrumb preview="true" expandEffectDuration="200" previewWidth="20" style="width: 300px" expandedBeginningItems="1" expandedEndItems="0">
                                    <p:menuitem value="选项"/>
                                    <p:menuitem value="查询今日结算记录" actionListener="#{financeManager.searchToadyPostings}" update="form1:forms"/>
                                </p:breadCrumb>
                                <h:panelGrid columns="6" style="width: 600px">
                                    <h:selectOneMenu value="#{financeManager.formType}">
                                        <f:selectItems value="#{applicationBean.formTypeSelectList}"></f:selectItems>
                                        <p:ajax  update="form1:postings" listener="#{financeManager.searchPostingsByType}" />
                                    </h:selectOneMenu>
                                    <h:outputLabel value="日期:"></h:outputLabel>
                                    <p:calendar value="#{financeManager.selectedDate}" pattern="yyyy-MM-dd"  navigator="true" ></p:calendar>
                                    <h:outputLabel value="模糊查询:"></h:outputLabel>
                                    <h:inputText value="#{financeManager.formNumber}" title="可输入部分单号进行查询"></h:inputText>
                                    <p:commandLink update="form1:postings" actionListener="#{financeManager.searchPostings}" title="查询">
                                        <p:graphicImage value="/resources/images/search.png"/>
                                    </p:commandLink>
                                    <p:ajaxStatus  style="width:16px;height:16px;">
                                        <f:facet name="start">
                                            <h:graphicImage  value="/resources/images/ajaxloading.gif" />
                                        </f:facet>
                                        <f:facet name="complete">
                                            <h:outputText value=""/>
                                        </f:facet>
                                    </p:ajaxStatus>
                                </h:panelGrid>
                            </h:panelGrid>
                        </f:facet>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="付款方式"/>
                            </f:facet>
                            <h:outputText value="#{posting.paymentMethod}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="金额"/>
                            </f:facet>
                            <h:outputText value="#{posting.amount}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="时间"/>
                            </f:facet>
                            <h:outputText value="#{posting.createdTime}">
                                <f:convertDateTime pattern="yyyy-MM-dd" timeZone="#{applicationBean.timeZone}"/>
                            </h:outputText>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="创建人"/>
                            </f:facet>
                            <h:outputText value="#{posting.createdBy.name}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="经手人"/>
                            </f:facet>
                            <h:outputText value="#{posting.handler.name}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="类别"/>
                            </f:facet>
                            <h:outputText value="#{posting.type}"/>
                        </p:column>
                    </p:dataTable>
                </h:form>
            </f:view>
        </ui:define>
    </ui:composition>
</html>
